﻿using System;
using System.ServiceModel;
using KPIS.GERP.Models.HRM;
using KPIS.GERP.Models.SYS;
using KPIS.GERP.Models.SYS.ViewModel;
using System.Collections.Generic;

namespace KPIS.GERP.WCF.SYS
{
    [ServiceContract]
    public interface ISysApprovalService
    {
        [OperationContract]
        List<Task> SelectTask();
        [OperationContract]
        GetAppPrcIdVM GetAppPrcId(GetAppPrcIdVM model);

        [OperationContract]
        CreateTaskVM CreateTask(CreateTaskVM model);

        [OperationContract]
        ActionTaskVM ActionTask(ActionTaskVM model);
        
        [OperationContract]
        CalAppPrcIdVm FindAppPrcId(CalAppPrcIdVm model);

        [OperationContract]
        UnwarnTaskCountVM CountUnwarnMessage(int empId, bool markAsWarn = true);

        [OperationContract]
        IEnumerable<ExecutivePosition> SelectExecutivePosition();

        [OperationContract]
        IEnumerable<ApproveProcessGroup> SelectApproveProcessGroup();

        [OperationContract]
        IEnumerable<ApproveProcess> SelectApproveProcess(int appPrcGrpEnum);

        [OperationContract]
        IEnumerable<ApprovePath> SelectApprovePath();

        [OperationContract]
        IEnumerable<ExecPosGroup> SelectExecPosGroup();

        [OperationContract]
        IEnumerable<ExecPosGroupDtls> SelectExecPosGroupDtls(int execPosId);

        [OperationContract]
        int InsertApproveProcess(string name, int appPrcGrpId, int? createdBy);

        [OperationContract]
        int InsertApproveProcessGroup(string name, int? createdBy);

        [OperationContract]
        int InsertApprovePathDtl(int appPathId, ApproverType approverType, int? execPosGroupId, bool isExecPosEmployeesOnlyInSameJobSitePath,
                                 int? posId, decimal? amountMin, decimal? amountMax, bool isApproveAble, bool isForwardable, bool isRejectable,
                                 bool isPendable, bool isSendBackable, bool isLockable, bool isTakebackAble, int? createdBy);

        [OperationContract]
        int InsertApprovePath(int appPrcId, int stepNo, int? createdBy);

        [OperationContract]
        int InsertExecPosGroup(string name, int? createdBy);

        [OperationContract]
        int InsertExecPosGroupDtl(int execPosGrpId, int execPosId, int? createdBy);

        [OperationContract]
        CheckAbsenceRuleResultVM UpdateAbsence(CheckAbsenceRuleResultVM resultCheckRule,
                                               string contactAddress,
                                               string description,
                                               string requestTitle,
                                               int updateBy);

        [OperationContract]
        CheckAbsenceRuleResultVM InsertAbsence(CheckAbsenceRuleResultVM resultCheckRule,
                                               string contactAddress,
                                               string description,
                                               string requestTitle,
                                               int createBy);

        [OperationContract]
        CheckAbsenceRuleResultVM CheckAbsenceRule(int empId, int? absenceId, int absenceTypeId, DateTime startDate, DateTime endDate,
                                                  string contactAddress, string description, int createdBy, string startTime,
                                                  string endTime, string requestTitle);
        
        [OperationContract]
        ICollection<ApprovePathSimulate> LoadApprovePathSimulate(int applyToEmpId, int appPrcId);
        
        [OperationContract]
        ICollection<ApprovePathSimulate> LoadApprovePathSimulate2(int applyToEmpId, int? relatedEmpId, int? createdByEmpId, int appPrcId);

        [OperationContract]
        int? GetTaskIdOfRef(int appPrcId, int refId);
        
        [OperationContract]
        string InsertMessageReplyWhichNoReplyButCompleted();

        [OperationContract]
        string CheckSimulateWrongOrdering();

    }
}